﻿<%@ Page Title="Repair Box" Theme="POSSystem" Language="C#" MasterPageFile="~/EditPages/Popup.Master" AutoEventWireup="true" CodeBehind="RepairBoxes.aspx.cs" Inherits="WebUI.EditPages.RepairBoxes" %>
<%@ Register Src="~/Controls/POSControls/RepairBoxListCtrl.ascx" TagName="RepairBoxList" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PopupHeadHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PopupToolbarHolder" runat="server">
    <script type="text/javascript" >
        function onAddBox() {
            var id = getSelectedItemID<%=lstRepairBox.ClientID %>();
            var returnValue = window.showModalDialog('<%=GetBoxEditPageLink() %>' + 'mode=new', '', 'dialogWidth=400px;dialogHeight=200px;resizable=no;help=no;unadorned=yes;');

            return returnValue > 0;
        }

        function onEditBox() {
            var id = getSelectedItemID<%=lstRepairBox.ClientID %>();
            if(id == null){
                alert("No item was selected!");
                return false;
            }
            var returnValue = window.showModalDialog('<%=GetBoxEditPageLink() %>' + 'mode=edit&id=' + id, '', 'dialogWidth=400px;dialogHeight=200px;resizable=no;help=no;unadorned=yes;');
            return returnValue > 0;
        }

        function onRemoveBox() {
            var id = HasCheckedItems<%=lstRepairBox.ClientID %>();
            if(id == false){
                alert("No item was selected!");
                return false;
            }
            return confirm("This action will delete all checked items. Do you want to continue?");
        }
    </script>
    <table class="popuptoolbar" width="100%">
        <tr>
            <td style="vertical-align:middle; text-align:left">
                <asp:LinkButton class="tbbutton" ID="btnAddBox" runat="server" OnClientClick="return onAddBox();"
                    OnClick="btnAddBox_OnClick">
                    <img src="../Images/AddRecord.gif" /><asp:Label ID="label5" runat="server" Text="Add"></asp:Label>
                </asp:LinkButton>
                <asp:LinkButton class="tbbutton" ID="btnEditBox" runat="server" OnClientClick=" return onEditBox();"
                    OnClick="btnAddBox_OnClick">
                    <img src="../Images/Edit.gif" /><asp:Label ID="label6" runat="server" Text="Edit"></asp:Label>
                </asp:LinkButton>
                <asp:LinkButton class="tbbutton" ID="btnDeleteBox" runat="server" OnClientClick="return onRemoveBox();"
                    OnClick="btnRemoveBox_OnClick">
                    <img src="../Images/Delete.gif" /><asp:Label ID="label7" runat="server" Text="Delete"></asp:Label>
                </asp:LinkButton>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PopupContentHolder" runat="server">
    <uc:RepairBoxList ID="lstRepairBox" runat="server"  Width="100%" AllowPaging="true" AllowSorting="true"
        AllowSelecting="true" SaveOnCommit="false" />
</asp:Content>
